package org.jeecg.modules.activiti.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.activiti.engine.impl.pvm.PvmTransition;
import org.activiti.engine.impl.pvm.process.ActivityImpl;
import org.activiti.engine.impl.task.TaskDefinition;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.activiti.entity.ActNode;
import org.jeecg.modules.activiti.vo.Department;
import org.jeecg.modules.activiti.vo.Role;

import javax.script.ScriptException;
import java.util.List;
import java.util.Map;

/**
 * @Description: 流程节点扩展表
 * @Author: jeecg-boot
 * @Date:   2020-03-30
 * @Version: V1.0
 */
public interface IActNodeService extends IService<ActNode> {

    List<String> getRoleByUserName(java.lang.String username);

    void deleteByNodeId(String id);

    List<LoginUser> findUserByNodeId(String nodeId);

    List<Role> findRoleByNodeId(String nodeId);

    List<Department> findDepartmentByNodeId(String nodeId);

    Boolean hasChooseDepHeader(String nodeId);

    Boolean hasChooseSponsor(String nodeId);

    List<ActNode> findByNodeIdAndType(String nodeId, int type);

    List<String> findDepartmentIdsByNodeId(String nodeId);

    List<LoginUser> queryAllUser();

    List<LoginUser> findUserByRoleId(String id);

    List<LoginUser> findUserDepartmentId(String id);

    TaskDefinition nextTaskDefinition(ActivityImpl activityImpl, String activityId,
                                      Map<String, Object> variables, String processInstanceId);

    Boolean getCurrenLineConditionResule(PvmTransition outTransition, Map<String, Object> variables);

    ActivityImpl getNextActivityImplByLineCondition(List<PvmTransition> outTransitionsTemp,
                                                    Map<String, Object> variables);
    boolean StringtoBoolean(String str, Map<String, Object> var) throws ScriptException;

    List<ActNode> findByNodeId(String nodeId);
}

